﻿<%@ Page Title="" Language="C#" MasterPageFile="~/RepairTracker.Master" AutoEventWireup="true" CodeBehind="report.aspx.cs" Inherits="RepairTracker.report" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ObjectDataSource ID="sourceProdcutSet" runat="server" 
        SelectMethod="DirectSearchRecords" TypeName="RepairTracker.Entity">
    <SelectParameters>
            <asp:ControlParameter ControlID="lstDistrict" Name="distictId" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="lstOwner" Name="ownerId" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="lstDevice" Name="deviceId" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="lstRepairFault" Name="realFaultId" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="caleInStart" Name="inDateStart" 
                PropertyName="SelectedDate" Type="DateTime" />           
            <asp:ControlParameter ControlID="caleInEnd" Name="inDateEnd" 
                PropertyName="SelectedDate" Type="DateTime" />
            <asp:ControlParameter ControlID="caleOutStart" Name="outDateStart" 
                PropertyName="SelectedDate" Type="DateTime" />
            <asp:ControlParameter ControlID="caleOutEnd" Name="outDateEnd" 
                PropertyName="SelectedDate" Type="DateTime" />
            <asp:ControlParameter ControlID="txtVersion" Name="version" PropertyName="Text" 
                Type="String" />
    </SelectParameters>

    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="sourceRepairCounts" runat="server">
    </asp:ObjectDataSource>
    <table>
    <tr>
    <td><asp:Calendar ID="caleInStart" runat="server" BackColor="White" 
            BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" 
            DayNameFormat="Shortest" FirstDayOfWeek="Monday" Font-Names="Verdana" 
            Font-Size="8pt" ForeColor="#003399" Height="200px" 
            onselectionchanged="caleInStart_SelectionChanged" Width="220px">
        <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
        <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
        <OtherMonthDayStyle ForeColor="#999999" />
        <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
        <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
        <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" 
            Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
        <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
        <WeekendDayStyle BackColor="#CCCCFF" />
        </asp:Calendar></td> 
    <td><asp:Calendar ID="caleInEnd" runat="server" BackColor="White" 
            BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" 
            DayNameFormat="Shortest" FirstDayOfWeek="Monday" Font-Names="Verdana" 
            Font-Size="8pt" ForeColor="#003399" Height="200px" 
            onselectionchanged="caleInEnd_SelectionChanged" Width="220px">
        <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
        <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
        <OtherMonthDayStyle ForeColor="#999999" />
        <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
        <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
        <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" 
            Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
        <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
        <WeekendDayStyle BackColor="#CCCCFF" />
        </asp:Calendar></td> 
        <td>
            <asp:Calendar ID="caleOutStart" runat="server" 
                onselectionchanged="caleOutStart_SelectionChanged" Visible="False"></asp:Calendar>
        </td>
        <td>
            <asp:Calendar ID="caleOutEnd" runat="server" 
                onselectionchanged="caleOutEnd_SelectionChanged" Visible="False"></asp:Calendar>
        </td>
    </tr>
    
    </table>
    <br />
    区县：<asp:DropDownList ID="lstDistrict" runat="server" AutoPostBack="True" 
        onselectedindexchanged="lstDistrict_SelectedIndexChanged">
    </asp:DropDownList>
&nbsp; 网点：<asp:DropDownList ID="lstOwner" runat="server" AutoPostBack="True" 
        onselectedindexchanged="lstOwner_SelectedIndexChanged">
    </asp:DropDownList>
&nbsp;设备类型：<asp:DropDownList ID="lstDevice" runat="server" AutoPostBack="True" 
        onselectedindexchanged="lstDevice_SelectedIndexChanged">
    </asp:DropDownList>
&nbsp;实际故障：<asp:DropDownList ID="lstRepairFault" runat="server" AutoPostBack="True" 
        onselectedindexchanged="lstRepairFault_SelectedIndexChanged">
    </asp:DropDownList>
    &nbsp;版本号：<asp:TextBox ID="txtVersion" runat="server" AutoPostBack="True"></asp:TextBox>
    <br />
    <br />
    <asp:Button ID="btnExcel" runat="server" Text="生成报表" onclick="btnExcel_Click" />
    <asp:Button ID="btnResetDate" runat="server" onclick="btnResetDate_Click" 
        Text="重置日期" />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="3" DataSourceID="sourceProdcutSet">
        <Columns>
            <asp:BoundField DataField="DistrictName" HeaderText="区县" 
                SortExpression="DistrictName" />
            <asp:BoundField DataField="OwnerName" HeaderText="网点" 
                SortExpression="OwnerName" />
            <asp:BoundField DataField="DeviceName" HeaderText="设备类型" 
                SortExpression="DeviceName" />
            <asp:BoundField DataField="SerialNo" HeaderText="序列号" 
                SortExpression="SerialNo" />
            <asp:BoundField DataField="PsamNo" HeaderText="Psam卡号" 
                SortExpression="PsamNo" />
            <asp:BoundField DataField="Version" HeaderText="固件版本" 
                SortExpression="Version" />
            <asp:BoundField DataField="RequestFaultName" HeaderText="报修故障" 
                SortExpression="RequestFaultName" />
            <asp:BoundField DataField="RealFaultName" HeaderText="实际故障" 
                SortExpression="RealFaultName" />
            <asp:BoundField DataField="InDate" HeaderText="入库时间" 
                SortExpression="InDate" />
            <asp:BoundField DataField="OutDate" HeaderText="出库时间" 
                SortExpression="OutDate" />
            <asp:BoundField DataField="RepairMethod" HeaderText="维修方法" 
                SortExpression="RepairMethod" />

        </Columns>

        <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
        <RowStyle ForeColor="#000066" />
        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#007DBB" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#00547E" />
    </asp:GridView>
</asp:Content>
